import torch


# 假设Config类中有以下参数需要调整
class Config:
    # 训练参数
    EPOCHS = 100  # 增加轮次
    BATCH_SIZE = 32  # 调整批次大小
    INITIAL_LR = 3e-4  # 调整学习率
    
    # 早停参数
    PATIENCE = 15  # 增加耐心值
    MIN_DELTA = 0.001  # 调整最小改进阈值
    
    # 损失权重
    SUBJ_WEIGHT_START = 0.9  # 主语任务初始权重
    SUBJ_WEIGHT_END = 0.7  # 主语任务最终权重
    
    # 模型参数
    EMBED_DIM = 300  # 增加嵌入维度
    HIDDEN_DIM = 256  # 增加隐藏层维度
    N_HEADS = 8
    DROPOUT = 0.3  # 增加dropout
    
    # 类别权重 - 保持平衡
    CLASS_WEIGHTS = [1.0, 1.0]

    # 文本参数
    MAX_LEN = 30

    # 模型参数
    EMBED_DIM = 200  # 确保只定义一次
    HIDDEN_DIM = 192
    N_HEADS = 8
    DROPOUT = 0.25

    # 路径配置
    MODEL_PATH = "v1/enhanced_model_best_subj.pth"
    DATA_PATH = "v1/augmented_data.csv"
    USER_DICT = "user_dict.txt"

    # 设备配置
    DEVICE = "mps" if torch.backends.mps.is_available() else "cpu"

    # 类别权重
    CLASS_WEIGHTS = [1.0, 1.8]  # [positive, negative]

    # 动态损失权重参数
    SUBJ_WEIGHT_START = 0.8
    SUBJ_WEIGHT_END = 0.5